//******************************************************************************
//Copyright(C) 2020-2021 zhejiang zhida dianzikeji Co., Ltd
//浙江智达电子科技有限公司
//File name:      variable.h
//Author:         zzg
//Version:        Ver0.1
//Date:           2021-4-25
//Description:    全局头文件调用/全局宏定义声明/全局变量声明
//History:
//******************************************************************************
#ifndef __UART_HAIER_UPLUS_PROTOCOL_DRV_H__
#define __UART_HAIER_UPLUS_PROTOCOL_DRV_H__

#include <mof_stdint.h>

typedef struct
{
	uint8_t Write_Start;
	uint8_t Read_IO;
	uint8_t Write_IO;
	uint8_t Busy;
	uint8_t ReadCharWindows[2];
	uint8_t ReadPtr;
	uint8_t WritePtr;
	uint8_t ReadLength;
	uint8_t ReadTimeout;
	uint8_t WriteLength;
	uint8_t WriteAppendbytes;
	uint8_t Reading;
	uint8_t Writing;
	uint8_t *p_ReadBuffer;
	uint8_t *p_WriteBuffer;
	uint8_t ReadChecksumAdj;
	uint8_t WriteChecksumAdj;
} mof_haier_uplus_uart_port_t;


void uart_haier_uplus_init(mof_haier_uplus_uart_port_t * p_uartport,uint8_t * txbuf,uint8_t * rxbuf);

void uart_haier_uplus_send(mof_haier_uplus_uart_port_t * p_uartport,uint8_t writelength);

void uart_haier_uplus_reset_rx(mof_haier_uplus_uart_port_t * p_uartport);
	
void uart_haier_uplus_tx_in_isr(mof_haier_uplus_uart_port_t * p_uartport);

void uart_haier_uplus_rx_in_isr(mof_haier_uplus_uart_port_t * p_uartport);

#endif
